package com.study.design.demo1;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * spring启动时加载数据
 *
 * @author: chenhs
 * @date: Created in 15:43 2019/11/9
 **/
@Component
public class LoadProductType implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        System.out.println("spring启动之后，执行一些初始化的操作（加载数据库的数据，初始化...）");
    }
}
